//单一值得运动		如果属性是opacity时，其值必须是0-100内适用

function doMove(obj, attr, target, endFn){
	clearInterval(obj.timer);

	obj.timer = setInterval(function (){
		var iCur = 0;

		if (attr == 'opacity') {
			iCur = parseInt(parseFloat(getStyle(obj, attr))*100);
		} else{
			iCur = parseInt(getStyle(obj, attr));
		};

		var iSpeed = (target - iCur)/8;
		iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed);

		if (attr == 'opacity') {
			obj.style.opacity = (iCur + iSpeed)/100;
			obj.style.filter = 'alpha(opacity:'+ (iCur + iSpeed) +')';
		} else{
			obj.style[attr] = iCur + iSpeed + 'px';
		};

		if (iCur == target) {
			clearInterval(obj.timer);
			endFn && endFn();
		};
	},30)
}

function getStyle(obj, attr){
	return obj.currentStyle ? obj.currentStyle[attr] : getComputedStyle(obj)[attr];
}